from webob import Response
from fusion.http.controllers import BaseController

class Proxy(BaseController):
    def index(self, req):
        view = self.load_view('proxy.index.html')

        if view:
            v = {}
            v['pac_url'] = '%s/proxy/proxy.pac' % req.host_url

            return view.render(**v)
        else:
            return None


    def proxy(self, req):   
        view = self.load_view('proxy.pac')

        if view:
            v = {}
            v['host'] = req.host

            return view.render(**v)
        else:
            return None

